#pragma once

#include<iostream>
#include <unistd.h>

namespace TaskModule
{
    class Task
    {
    public:
        Task() {}
        Task(int x,int y) :_x(x),_y(y)
        {}
        void Excute()
        {
            sleep(1); //用1S来模拟任务处理的时长
            _result = _x+_y;//入库，访问缓存，访问网络，打印日志等
        }
        int X() {return _x;}
        int Y() {return _y;}
        int Result() {return _result;}
        ~Task() {}
    private:
        int _x;
        int _y;
        int _result;
    };
}